# 一个数恰好等于除了它以外的因子之和，这个数就称为"完数"。
# 编程序找出1000以内的所有完数,(6是一个"完数",它的因子是1,2,3)
# 6,28,496

# 构造函数
def perfect_number(input_number):
    number = int(input_number)
    nums = 0
    for num in range(1,number):
        if number % num == 0:
            nums += num
    if nums == number:
        print(f"{input_number}是完数")
    else:
        print(f"{input_number}不是完数")
    return print

input_number = int(input("请输入一个数:"))
result = perfect_number(input_number)
print(result)

# for input_number in range(1,1000):
#     result = perfect_number(input_number)
#     print(result)